home *** CD-ROM | disk | FTP | other *** search
/ Power Programmierung / Power-Programmierung (Tewi)(1994).iso / magazine / pctchnqs / 1992 / number2 / vbplay / form.txt next >
Text File  |  1992-03-24  |  1KB  |  63 lines

  1. Sub Form_Load ()
  2.   '
  3.   ' Initialize the sound system
  4.   '
  5.   status% = OpenSound()
  6.   Select Case status
  7.     Case S_SERDVNA
  8.       MsgBox ("Music already in use")
  9.       CloseSound
  10.       End
  11.  
  12.     Case S_SEROFM
  13.       MsgBox ("Out of Memory")
  14.       CloseSound
  15.       End
  16.  
  17.   End Select
  18.  
  19.   '
  20.   ' Initialize voice buffer and default conditions
  21.   '
  22.   status% = SetVoiceQueueSize(1, Q_BUFF_SIZE)
  23.   length% = 4
  24.   octave% = 3
  25.   mode% = S_NORMAL
  26.   temp% = 120
  27.  
  28. End Sub
  29.  
  30. Sub OnPlay_Timer ()
  31.   Static song$(5)
  32.   Static songptr%
  33.  
  34.   '
  35.   ' Initialize array first time through
  36.   '
  37.   If song$(1) = "" Then
  38.     song$(1) = "O4MLT135D6P60<B10GP64GP64GP56MNE8D8G8MLAMNF#8"
  39.     song$(2) = "MLGMNP32E8D8GE8D8GE8D8F#2.P16MLD8E8F#GMNA.P64"
  40.     song$(3) = "MLD8GAMNB.G8MLA8MNBMLG8A8MNBMLG8A2.P15>MND5"
  41.     song$(4) = "<B13GGMLGMNE8D8G8MLAP64MNF#8MLGP32MNF#8F8E
  42.     song$(5) = "G#8B8EBMLA2.MNP8D8D8MLG.P64F#8GP64BP64A.P64
  43.     song$(6) = "G#8P64AP17F#8P64D8P64E8GP60E7GP64F#P64G2.P6P6"
  44.   End If
  45.  
  46.   '
  47.   ' Make sure there are notes in the buffer
  48.   '
  49.   If CountVoiceNotes(1) < Q_THRESHHOLD Then
  50.     Play (song$(songptr% Mod 6 + 1))
  51.     songptr% = songptr% + 1
  52.     status% = StartSound()
  53.   End If
  54. End Sub
  55.  
  56. Sub Form_Unload (Cancel As Integer)
  57.   CloseSound
  58. End Sub
  59.  
  60. Sub Quit_Click ()
  61.   CloseSound: End
  62. End Sub
  63.